home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / overview / moreisbetter / mib-libraries / moredevices / interruptsafedebug / testinterruptsafedebug / testinterruptsafedebug.c next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  1.7 KB  |  75 lines

  1. /*
  2.     File:        TestInterruptSafeDebug.c
  3.  
  4.     Contains:    Test program for the InterruptSafeDebug library.
  5.  
  6.     Written by:    Quinn "The Eskimo!"
  7.  
  8.     Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.  
  20.          <1>    23/11/98    Quinn   First checked in.
  21. */
  22.  
  23. /////////////////////////////////////////////////////////////////////
  24.  
  25. // Setup MoreIsBetter environment
  26.  
  27. #include "MoreSetup.h"
  28.  
  29. // Standard Mac OS interfaces
  30.  
  31. #include <MacTypes.h>
  32.  
  33. // Standard C interfaces
  34.  
  35. #include <stdio.h>
  36. #include <string.h>
  37.  
  38. // Module to be tested
  39.  
  40. #include "InterruptSafeDebug.h"
  41.  
  42. /////////////////////////////////////////////////////////////////////
  43.  
  44. void main(void)
  45. {
  46.     OSStatus err;
  47.     ItemCount i;
  48.     
  49.     printf("Hello Cruel World!\n");
  50.     fflush(stdout);
  51.     
  52.     err = InitInterruptSafeDebug();
  53.     if (err == noErr) {
  54.  
  55.         ISdebugstr("Hello Cruel World!");
  56.         
  57.         for (i = 0; i < 256; i++) {
  58.             ISDebugChar(i);
  59.         }
  60.         for (i = 0; i < 100; i++) {
  61.             ISDebugStr("\pHello Cruel World");
  62.         }
  63.  
  64.         ISDebugText( (UInt8 *) "ISDebugText", strlen("ISDebugText"));
  65.         ISdebugstr ("ISdebugstr");
  66.     }
  67.     
  68.     if (err == noErr) {
  69.         printf("Success\n");
  70.     } else {
  71.         printf("Failed with error %ld.\n", err);
  72.     }
  73.     printf("Done.  Press command-Q to Quit.\n");
  74. }
  75.